package com.sz.biz.common.base.dto;

import com.sz.common.base.entity.Entity;

public class CountryArea implements Entity {
    /**
     * 二字码
     */
    private String countryCode;
    /**
     * 地区id
     */
    private String areaId;

    /**
     *
     */
    private String name;

    /**
     * type
     *
     * @param countryCode
     * @param name
     */

    private int type;

    public String getAreaId() {
        return areaId;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public CountryArea() {
    }

    public CountryArea(String countryCode, String name) {
        this.countryCode = countryCode;
        this.name = name;
    }

    public CountryArea(int type, String countryCode, String areaId, String name) {
        this.type = type;
        this.areaId = areaId;
        this.countryCode = countryCode;
        this.name = name;
    }

    /**
     * 仅为保持前端兼容性，请勿调用
     *
     * @return
     */
    @Deprecated
    public String getFigureCode() {
        return this.getCountryCode();
    }

    /**
     * 仅为保持前端兼容性，请勿调用
     *
     * @param countryCode
     */
    @Deprecated
    public void setFigureCode(String countryCode) {
        this.setCountryCode(countryCode);
    }

    public String getCountryCode() {
        return countryCode;
    }

    public void setCountryCode(String countryCode) {
        this.countryCode = countryCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        CountryArea that = (CountryArea) o;

        return countryCode != null ? countryCode.equals(that.countryCode) : that.countryCode == null;

    }

    @Override
    public int hashCode() {
        return countryCode != null ? countryCode.hashCode() : 0;
    }
}